<template>
  <div class="layout-pd">
    <zh-card title="我的全局配置信息" mode="default">
      <template #headerRight>
				<zh-button button-type="edit" v-if="pageData.showFlag" @click="onClickEdit">编辑</zh-button>
        <zh-button  v-if="!pageData.showFlag" @click="save" type="success">保存</zh-button>
        <zh-button  v-if="!pageData.showFlag" @click="cancel" type="info">取消</zh-button>
			</template>
    <genUserConfigForm
          ref="detailFormRef"
          :disabled="pageData.showFlag"
          :id="pageData.selectRow.id"
          @canner="cancel"
      ></genUserConfigForm>
      </zh-card>
  </div>
</template>
<script lang="ts" setup name="genUserConfigIndex">
import genUserConfigForm from './component/genUserConfigForm.vue';

// ------------------接收传入参数(组件)-------------------

// ------------------钩子函数----------------------------
// 初始化
onMounted(() => {
  init();
});

// ------------------定义子组件--------------------------
const detailFormRef = ref();

// ------------------变量区------------------------------
const pageData = reactive({
  advanced: false,
  dictData: {} as any,
  title: '',
  detailVisible: false,
  showFlag: false,
  selectRow: {} as any,
  saveLoading: false,
  showType: true,
  campusParam: {} as any,
});
// ------------------方法区------------------------------
const init = () => {
  pageData.selectRow = {};
  pageData.showFlag = true;
};

const onClickEdit=()=>{
  pageData.showFlag = false;
}
const cancel=()=>{
  pageData.showFlag = true;
}
//保存
const save = () => {
  detailFormRef.value.save();
};

</script>
<style lang="scss" scoped></style>
